package com.enzo.prms.task.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.enzo.prms.common.base.dao.BaseDAO;
import com.enzo.prms.common.base.service.BaseServiceImpl;
import com.enzo.prms.task.model.Tlist;

@Component("tlistService")
public class TlistServiceImpl extends BaseServiceImpl<Tlist> implements TlistService {

	@Override
	public Tlist getTlistByName(String tlistName) {
		String hql = "from Tlist t where t.listName=:listName";
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("listName", tlistName);
		List<Tlist> results = getListByHQL(hql, params);
		if (results != null && results.size() > 0) {
			return results.get(0);
		}
		return null;
	}

	@Resource(name="tlistDao")
	public void setBaseDAO(BaseDAO<Tlist> baseDAO) {
		super.setBaseDAO(baseDAO);
	}

}
